package com.codejiwei.flink.local;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * author: codejiwei
 * date: 2023/4/19
 * desc: flink data stream example program
 **/
public class WindowWordCount {

    public static void main(String[] args) throws Exception {
        Configuration conf = new Configuration();
        StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(conf);
        env.setParallelism(1);

//        DataStreamSource<String> sourceDS = env.readTextFile("E:\\my_workspace\\bigdata_flink\\bigdata_flink\\flink_1_12\\src\\main\\resources\\json.data");
//        sourceDS.print();

        String hostname = "hadoop102";
        int port = 9999;
        DataStreamSource<String> sourceDS = env.socketTextStream(hostname, port);



        env.execute();


    }

}
